const waitTime = (time = 100) => {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve(true);
    }, time);
  });
};

export default {
  'POST /api/user/login': async (req, res) => {
    await waitTime(2000);
    res.send({
      code: 200,
      msg: 'ok',
      data: {
        userId: '2222222',
        token: '12345678901234567890',
      },
    });
  },

  'POST /api/user/getUserInfo': async (req, res) => {
    await waitTime(300);
    res.send({
      code: 200,
      msg: 'ok',
      data: {
        userId: '2222222',
        name: '本初',
        avatar:
          'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
        email: 'antdesign@alipay.com',
        signature: '海纳百川，有容乃大',
      },
    });
  },

  'POST /api/user/clearLogin': async (req, res) => {
    await waitTime(200);
    res.send({
      code: 200,
      msg: 'ok',
      data: {},
    });
  },
};
